package com.beten.ui.util;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

public abstract class BasePanel  extends LinearLayout{

	private LayoutInflater mInflater;
	protected Context context;
	protected View  panel;
	 
	public BasePanel(Context _context) {
		super(_context);
		ReadXml(_context);
	}
	
	public BasePanel(Context _context, AttributeSet attrs) {
		super(_context, attrs);
		ReadXml(_context);
	}
	abstract protected int GetXmlId();
	abstract protected void Init();
	private void ReadXml(Context _context) {
		context = _context;
		this.mInflater = LayoutInflater.from(context);
		panel = (View) mInflater.inflate(GetXmlId(), null);
		LayoutParams layout=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
		this.addView(panel,layout);
		Init();
	}
	

	
}
